<template>
	<view>
		<view class="scroll-view">
			<!-- 左侧滑动区   {height: wh + 'px'}   有点bug -->
			<scroll-view class="left-scroll" scroll-y="true" style="height: 500px;">
				<!-- <block v-for="(item, i)in cateList" :key="i">
					<view class="['left-scroll-item',i === active ? 'active' : '']" @click="activeChange(i)" >
					{{item.name}}
					</view>
				</block> -->
				<view class="left-scroll-item active">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
				<view class="left-scroll-item">xxx</view>
			</scroll-view>
			
			右侧数据
			<scroll-view scroll-y="true" style="height: 300px;">
				
				
				<view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view><view>yyyy</view>
				
			</scroll-view>
			
			<!-- 渲染当前1的左侧导航栏的子元素 -->
			<view class="cate-lv3-list">
				<view class="cate-lv3-item" v-for="(item3, i3) in item2.xx" :key="i3">
					<image src=""></image>
					<text>{{}}</text>
				</view>
			</view>
			
			
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {
				//当前设备高度
				wh: 0,
				cateList :[],
				//当前选择的view
				active: 0,
				//二级菜单的子元素
				children : [],
				
			};
		},onLoad(){
		const sysInfo = uni.getSystemInfoSync()//获取设备信息
		console.log(sysInfo)
		this.wh = sysInfo.windowHeight
		this.getCateList()
	},
	methods:{
		getCateList(){
			uri.request({
				url: '',
				method:'POST',
				success:(res)=>{
					
					//为二级分类赋值
				//	this.children = this.res.xx
					
				}
			})
		},
		activeChange(i){
			console.log(i)
			//动态跟踪导航条
			this.active=i
			
			//重新为二级分类赋值
			//this.children=this.cateList[i].xx
			
		}
	}
	}
	
</script>

<style lang="scss">
	
.cate-lv3-list{
	display: flex;
	flex-wrap: wrap;
}	
.cate-lv3-item{
	width: 33%;
	display: flex;
	flex-direction: column;
	justify-content: center;
	
	
}

	
.scroll-view{
	display: flex;
}	
	
.left-scroll{
	width: 120px;
}

.left-scroll-item{
	background-color: aquamarine;
	line-height: 60px;
	text-align: center;
	font-size: 12px;
	
	
	&.active{
		background-color: aquamarine;
		position: relative;
		
		&::before{
			content: '';
			display: block;
			width: 3px;
			height: 30px;
			background-color: red;
			position: absolute;
			top:50%;
			left: 0%;
			transform: translateY(-50%);
		}
	}
}
</style>
